Skip to content

doc(DockView): update layout sample code#8019

Merged
ArgoZhang merged 3 commits into
mainfrom
chore-dockview
May 19, 2026
Merged

doc(DockView): update layout sample code#8019
ArgoZhang merged 3 commits into
mainfrom
chore-dockview

Conversation

@ArgoZhang
Copy link
Copy Markdown
Member

@ArgoZhang ArgoZhang commented May 19, 2026

Link issues

fixes #8018

Summary By Copilot

Regression?

  • Yes
  • No

Risk

  • High
  • Medium
  • Low

Verification

  • Manual (required)
  • Automated

Packaging changes reviewed?

  • Yes
  • No
  • N/A

☑️ Self Check before Merge

⚠️ Please check all items below before review. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • Merge the latest code from the main branch

Summary by Sourcery

Update DockView layout sample configuration to reflect the new layout schema and keyed tabs.

Bug Fixes:

  • Align DockView sample layout JSON with the current layout API structure, including wrapping grid and panels under a layout root and adding tab keys.

Enhancements:

  • Adjust DockView sample configs to include explicit tab keys and an empty top-level panels collection for clarity and consistency with the latest layout format.

Copilot AI review requested due to automatic review settings May 19, 2026 04:45
@bb-auto bb-auto Bot added the documentation Improvements or additions to documentation label May 19, 2026
@bb-auto bb-auto Bot added this to the v10.6.0 milestone May 19, 2026
@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai Bot commented May 19, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Updates DockView layout sample JSON configurations to match the new DockView API schema and to provide stable tab keys in the sample code.

File-Level Changes

Change Details Files
Align DockView sample layout JSON with new schema and add explicit tab keys.
  • Wrap existing grid/panels/activeGroup structure under a new top-level "layout" object for all three layout configs.
  • Append an empty top-level "panels":[] collection alongside the new "layout" object to reflect the updated schema.
  • Set non-null, stable "key" values (tab1/tab2/tab3) for each panel in all layout configurations instead of null.
  • Remove the BOM from the file header comment line.
src/BootstrapBlazor.Server/Components/Samples/DockViews2/DockViewLayout.razor.cs

Assessment against linked issues

Issue Objective Addressed Explanation
#8018 Update the DockView layout sample code (layout configuration constants) to reflect the current/expected DockView layout schema and parameters.

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@ArgoZhang ArgoZhang merged commit 1befa58 into main May 19, 2026
5 checks passed
@ArgoZhang ArgoZhang deleted the chore-dockview branch May 19, 2026 04:45
Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • The layout JSON constants are very long single-line strings, which makes them hard to read and maintain; consider formatting them as multi-line JSON (or building them as C# objects and serializing) to improve clarity and reduce the chance of subtle mistakes.
  • The new schema introduces both layout.panels and a top-level panels array; please double-check whether the empty top-level panels is required by the API or if it can be removed to avoid confusion about which panels collection is actually used.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The layout JSON constants are very long single-line strings, which makes them hard to read and maintain; consider formatting them as multi-line JSON (or building them as C# objects and serializing) to improve clarity and reduce the chance of subtle mistakes.
- The new schema introduces both `layout.panels` and a top-level `panels` array; please double-check whether the empty top-level `panels` is required by the API or if it can be removed to avoid confusion about which `panels` collection is actually used.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the DockViewV2 custom layout sample to match the newer BootstrapBlazor.DockView package layout configuration format.

Changes:

  • Updates BootstrapBlazor.DockView from 10.0.9 to 10.0.13.
  • Wraps saved layout JSON under a top-level layout property and adds panel key metadata.
  • Adjusts sample layout configs used by the DockViewV2 layout toggle demo.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/BootstrapBlazor.Server/BootstrapBlazor.Server.csproj Updates the DockView package dependency.
src/BootstrapBlazor.Server/Components/Samples/DockViews2/DockViewLayout.razor.cs Updates hard-coded DockViewV2 layout sample JSON configs.
Comments suppressed due to low confidence (1)

src/BootstrapBlazor.Server/Components/Samples/DockViews2/DockViewLayout.razor.cs:43

  • The params.key values here are shifted relative to the declared DockViewComponent keys (标签一/tab1, 标签二/tab2, 标签三/tab3). Because these keys identify which component content should be restored into each panel, this layout can show the wrong content under each tab title. Please update the keys so each panel's title uses the matching component key.
    const string LayoutConfig3 = """{"layout":{"grid":{"root":{"type":"branch","data":[{"type":"leaf","data":{"views":["bb_50123566"],"activeView":"bb_50123566","id":"2"},"size":300},{"type":"leaf","data":{"views":["bb_34309365","bb_24575431"],"activeView":"bb_24575431","id":"1"},"size":301}],"size":1092},"width":1092,"height":601,"orientation":"VERTICAL"},"panels":{"bb_34309365":{"id":"bb_34309365","contentComponent":"component","tabComponent":"component","params":{"componentName":"component","title":"标签二","titleWidth":null,"titleClass":null,"class":null,"visible":true,"showClose":true,"width":null,"height":null,"key":"tab1","isLock":false,"type":"component","id":"bb_34309365","additionalAttributes":null},"title":"标签二"},"bb_24575431":{"id":"bb_24575431","contentComponent":"component","tabComponent":"component","params":{"componentName":"component","title":"标签三","titleWidth":null,"titleClass":null,"class":null,"visible":true,"showClose":true,"width":null,"height":null,"key":"tab2","isLock":false,"type":"component","id":"bb_24575431","additionalAttributes":null},"title":"标签三"},"bb_50123566":{"id":"bb_50123566","contentComponent":"component","tabComponent":"component","params":{"componentName":"component","title":"标签一","titleWidth":null,"titleClass":null,"class":null,"visible":true,"showClose":true,"width":null,"height":null,"key":"tab3","isLock":false,"type":"component","id":"bb_50123566","additionalAttributes":null},"title":"标签一"}},"activeGroup":"1"},"panels":[]}""";

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

const string LayoutConfig1 = """{"layout":{"grid":{"root":{"type":"branch","data":[{"type":"branch","data":[{"type":"leaf","data":{"views":["bb_5893789"],"activeView":"bb_5893789","id":"0"},"size":364},{"type":"leaf","data":{"views":["bb_11251481"],"activeView":"bb_11251481","id":"1"},"size":364},{"type":"leaf","data":{"views":["bb_39754773"],"activeView":"bb_39754773","id":"2"},"size":364}],"size":601}],"size":1092},"width":1092,"height":601,"orientation":"VERTICAL"},"panels":{"bb_5893789":{"id":"bb_5893789","contentComponent":"component","tabComponent":"component","params":{"componentName":"component","title":"标签一","titleWidth":null,"titleClass":null,"class":null,"visible":true,"showClose":true,"width":null,"height":null,"key":"tab1","isLock":false,"type":"component","id":"bb_5893789","additionalAttributes":null},"title":"标签一"},"bb_11251481":{"id":"bb_11251481","contentComponent":"component","tabComponent":"component","params":{"componentName":"component","title":"标签二","titleWidth":null,"titleClass":null,"class":null,"visible":true,"showClose":true,"width":null,"height":null,"key":"tab2","isLock":false,"type":"component","id":"bb_11251481","additionalAttributes":null},"title":"标签二"},"bb_39754773":{"id":"bb_39754773","contentComponent":"component","tabComponent":"component","params":{"componentName":"component","title":"标签三","titleWidth":null,"titleClass":null,"class":null,"visible":true,"showClose":true,"width":null,"height":null,"key":"tab3","isLock":false,"type":"component","id":"bb_39754773","additionalAttributes":null},"title":"标签三"}},"activeGroup":"1"},"panels":[]}""";

const string LayoutConfig2 = """{"grid":{"root":{"type":"branch","data":[{"type":"leaf","data":{"views":["bb_50123566"],"activeView":"bb_50123566","id":"2"},"size":200},{"type":"leaf","data":{"views":["bb_34309365"],"activeView":"bb_34309365","id":"1"},"size":200},{"type":"leaf","data":{"views":["bb_24575431"],"activeView":"bb_24575431","id":"0"},"size":201}],"size":1092},"width":1092,"height":601,"orientation":"VERTICAL"},"panels":{"bb_24575431":{"id":"bb_24575431","contentComponent":"component","tabComponent":"component","params":{"componentName":"component","title":"标签三","titleWidth":null,"titleClass":null,"class":null,"visible":true,"showClose":true,"width":null,"height":null,"key":null,"isLock":false,"type":"component","id":"bb_24575431","additionalAttributes":null},"title":"标签三"},"bb_34309365":{"id":"bb_34309365","contentComponent":"component","tabComponent":"component","params":{"componentName":"component","title":"标签二","titleWidth":null,"titleClass":null,"class":null,"visible":true,"showClose":true,"width":null,"height":null,"key":null,"isLock":false,"type":"component","id":"bb_34309365","additionalAttributes":null},"title":"标签二"},"bb_50123566":{"id":"bb_50123566","contentComponent":"component","tabComponent":"component","params":{"componentName":"component","title":"标签一","titleWidth":null,"titleClass":null,"class":null,"visible":true,"showClose":true,"width":null,"height":null,"key":null,"isLock":false,"type":"component","id":"bb_50123566","additionalAttributes":null},"title":"标签一"}},"activeGroup":"2"}""";
const string LayoutConfig2 = """{"layout":{"grid":{"root":{"type":"branch","data":[{"type":"leaf","data":{"views":["bb_50123566"],"activeView":"bb_50123566","id":"2"},"size":200},{"type":"leaf","data":{"views":["bb_34309365"],"activeView":"bb_34309365","id":"1"},"size":200},{"type":"leaf","data":{"views":["bb_24575431"],"activeView":"bb_24575431","id":"0"},"size":201}],"size":1092},"width":1092,"height":601,"orientation":"VERTICAL"},"panels":{"bb_24575431":{"id":"bb_24575431","contentComponent":"component","tabComponent":"component","params":{"componentName":"component","title":"标签三","titleWidth":null,"titleClass":null,"class":null,"visible":true,"showClose":true,"width":null,"height":null,"key":"tab1","isLock":false,"type":"component","id":"bb_24575431","additionalAttributes":null},"title":"标签三"},"bb_34309365":{"id":"bb_34309365","contentComponent":"component","tabComponent":"component","params":{"componentName":"component","title":"标签二","titleWidth":null,"titleClass":null,"class":null,"visible":true,"showClose":true,"width":null,"height":null,"key":"tab2","isLock":false,"type":"component","id":"bb_34309365","additionalAttributes":null},"title":"标签二"},"bb_50123566":{"id":"bb_50123566","contentComponent":"component","tabComponent":"component","params":{"componentName":"component","title":"标签一","titleWidth":null,"titleClass":null,"class":null,"visible":true,"showClose":true,"width":null,"height":null,"key":"tab3","isLock":false,"type":"component","id":"bb_50123566","additionalAttributes":null},"title":"标签一"}},"activeGroup":"2"},"panels":[]}""";
@codecov
Copy link
Copy Markdown

codecov Bot commented May 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (eebde87) to head (cbdfade).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #8019   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          766       766           
  Lines        34123     34123           
  Branches      4692      4692           
=========================================
  Hits         34123     34123           
Flag Coverage Δ
BB 100.00% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

doc(DockView): update layout sample code

2 participants